<template>
	<el-form :model="formData" ref="formRef" :rules="formRules" label-width="8rem">
		<el-row type="flex" :gutter="10">
			<!-- <el-col :span="12">
				<el-form-item label="收款户名" prop="receive_account_name">
					<el-input :disabled="isdisabled" v-model="formData.receive_account_name" clearable placeholder="请输入收款户名"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="收款账号" prop="receive_account_no">
					<el-input :disabled="isdisabled" v-model="formData.receive_account_no" clearable placeholder="请输入收款账号"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="收款银行" prop="receive_bank_name">
					<el-input :disabled="isdisabled" v-model="formData.receive_bank_name" clearable placeholder="请输入收款银行"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="充值订单号" prop="order_sn">
					<el-input :disabled="isdisabled" v-model="formData.order_sn" clearable placeholder="请输入充值订单号"></el-input>
				</el-form-item>
			</el-col> -->
			<el-col :span="12">
				<el-form-item label="充值金额" prop="money">
					<el-input :disabled="isdisabled" v-model="formData.money" clearable placeholder="请输入充值金额"></el-input>
				</el-form-item>
			</el-col>
			<!-- <el-col :span="12">
				<el-form-item label="存管系统订单号 (拉卡拉返回)" prop="order_no">
					<el-input :disabled="isdisabled" v-model="formData.order_no" clearable placeholder="请输入存管系统订单号 (拉卡拉返回)"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="打款备注(拉卡拉返回)" prop="pay_no">
					<el-input :disabled="isdisabled" v-model="formData.pay_no" clearable placeholder="请输入打款备注(拉卡拉返回)"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="状态" prop="status">
					<el-select v-model="formData.status" placeholder="请选择" :disabled="isdisabled" >
						<el-option v-for="(item,index) in statuslist" :key="index" :label="item" :value="index">
						</el-option>
					</el-select>
				</el-form-item>
			</el-col> -->
		</el-row>
		<el-row type="flex" justify="center">
			<el-button type="primary" :disabled="isdisabled"  icon="el-icon-check" @click="onConfirm">确认</el-button>
			<el-button type="default" icon="el-icon-close" @click="onCancel">取消</el-button>
		</el-row>
	</el-form>
</template>

<script>
	export default {
		name: "member-search",
		props: {
			formData: {
				type: Object,
				default: () => {}
			},
			isdisabled:{
				type:Boolean,
				default:false
			}
		},
		components: {
			"el-upload-image": () => import("@/components/el-upload-image.vue"),
		},
		data() {
			return {
				formRules: {
					// receive_account_name: [{
					// 	required: true,
					// 	message: '请输入',
					// 	trigger: 'change'
					// }],
					// receive_account_no: [{required: true,message: '请输入',trigger: 'change'}],
					// receive_bank_name: [{required: true,message: '请输入',trigger: 'change'}],
					// order_sn: [{required: true,message: '请输入',trigger: 'change'}],
					money: [{required: true,message: '请输入',trigger: 'change'}],
					// order_no: [{required: true,message: '请输入',trigger: 'change'}],
					// pay_no: [{required: true,message: '请输入',trigger: 'change'}],
					// status: [{required: true,message: '请输入',trigger: 'change'}],
				},
				statuslist: ['待打款', '已打款'], //状态 o待打款 1已打款
			};
		},
		methods: {
			onConfirm() {
				this.$refs.formRef.validate((valid) => {
					if (valid) {
						// alert('submit!');
						console.log(this.formData)
						this.$emit("search", this.formData);
						this.$parent.$emit("update:visible", false);
						this.$refs.formRef.resetFields()
					} else {
						console.log('error submit!!');
						return false;
					}
				});
			},
			onCancel() {
				this.$parent.$emit("update:visible", false);
				this.$refs.formRef.resetFields();
			}
		}
	};
</script>